package com.kefu.sys.mapper;

import com.kefu.common.mybatis.KefuMapper;
import com.kefu.sys.model.SysMenu;
import org.apache.ibatis.annotations.Select;

import java.util.List;


public interface SysMenuMapper extends KefuMapper<SysMenu> {

    @Select("SELECT t1.* from sys_menu t1,sys_role_menu t2 where t1.id = t2.menu_id and t1.data_status = 1 and t2.role_id = #{arg0}")
    List<SysMenu> getMenuByRoleId(String roleId);

    @Select("select COALESCE(max(weight),0) from sys_menu where parent_id = #{arg0}")
    int getMaxWeight(String parentId);
}